<!--微信支付配置页面-->
<template>
  <el-card shadow="never" class="aui-card--fill">
    <div>
      <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
        <el-form-item>
          <el-button @click="getDataList()">刷新</el-button>
        </el-form-item>
      </el-form>
      <el-table v-loading="dataListLoading" :data="dataList" stripe highlight-current-row
                @selection-change="dataListSelectionChangeHandle" @sort-change="dataListSortChangeHandle"
                style="width: 100%;">
        <el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
        <el-table-column prop="apiv3Key" label="api3" header-align="center" align="center" width="" fixed show-overflow-tooltip></el-table-column>
        <el-table-column prop="certSerialNo" label="证书编号" header-align="center" align="center" width="" fixed show-overflow-tooltip></el-table-column>
        <el-table-column prop="mchid" label="商户号" header-align="center" align="center" width="" fixed show-overflow-tooltip></el-table-column>
        <el-table-column prop="privateCertString" label="证书cert" header-align="center" align="center" width="" show-overflow-tooltip>
          <template slot-scope="{row}">
            <el-popover trigger="click" placement="top">
              <p>{{row.privateCertString }}</p>
              <div slot="reference" class="name-wrapper">
                <el-tag size="medium">查看</el-tag>
              </div>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column prop="privateKeyString" label="证书key" header-align="center" align="center" width="">
          <template slot-scope="{row}">
            <el-popover trigger="click" placement="top">
              <p>{{row.privateKeyString }}</p>
              <div slot="reference" class="name-wrapper">
                <el-tag size="medium">查看</el-tag>
              </div>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column prop="createDate" label="创建日期" header-align="center" align="center"></el-table-column>
        <el-table-column label="操作" fixed="right" header-align="center" align="center" width="">
          <template slot-scope="scope">
            <el-link v-if="$hasPermission('api:configWxpay:update')" type="primary"
                       @click="addOrUpdateHandle(scope.row.id)">修改
            </el-link>
          </template>
        </el-table-column>

      </el-table>
      <!-- 弹窗, 新增 / 修改 -->
      <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
    </div>

  </el-card>
</template>

<script>
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './configWxpayAddOrUpdate.vue'
export default {
  mixins: [mixinViewModule],
  data() {
    return {
      mixinViewModuleOptions: {
        getDataListURL: '/api/configWxpay/page',
        getDataListIsPage: true,
        deleteURL: '/api/configWxpay',
        deleteIsBatch: true
      },
      dataForm: {
        id: '',                         //id
        apiv3Key:'',                    //api3
        certSerialNo:'',                //证书编号
        mchid: '',                      //商户号
        privateCertString: '',          //证书cert
        privateKeyString:''             //证书key
      },
    }
  },
  components: {
    AddOrUpdate
  },
  created() {

  },
  methods: {}
}
</script>
<style lang="scss">
.ellipsis2 {
  /* //超出两行省略号 */
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}
</style>
